package rpg.map;

import square.data.MapObjectData;

/**
 * 
 * @author Pedro Silva Moreira
 */
public abstract class MapObject {

	public static Long idCounter = 0L;
	private final Long id = idCounter++;
	private Integer side = MapObjectData.SIDE_LEFT;
	private Location location;
	private MapObjectData data, dataReflect;

	// Generation
	public MapObject() {
	}

	// Get & Set
	public Map getMap() {
		if (getLocation() != null) {
			return (Map) getLocation().getMap();
		}
		return null;
	}

	public static Long getIdCounter() {
		return idCounter;
	}

	public static void setIdCounter(Long idCounter) {
		MapObject.idCounter = idCounter;
	}

	public Long getId() {
		return id;
	}

	public static void setIdCounter(long idCounter) {
		MapObject.idCounter = idCounter;
	}

	public Integer getSide() {
		return side;
	}

	public void setSide(Integer side) {
		this.side = side;
	}

	public Location getLocation() {
		return location;
	}

	public void setLocation(Location location) {
		this.location = location;
	}

	public MapObjectData getData() {
		return data;
	}

	public void setData(MapObjectData data) {
		this.data = data;
	}

	public MapObjectData getDataReflect() {
		return dataReflect;
	}

	public void setDataReflect(MapObjectData dataReflect) {
		this.dataReflect = dataReflect;
	}

	public abstract void removeFromMap();
}